﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ListMonthSupplyPlan.aspx.cs" Inherits="lcs.Web.supply.ListMonthSupplyPlan"  EnableEventValidation="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            height: 15px;
        }
    </style>
    <link href="../../css/myStyle.css" rel="stylesheet" />
    <link href="../style.css" type="text/css" rel="stylesheet" />
     <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="../Scripts/JsTools.js" type="text/javascript"></script>
    <script src="../My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript">

        function OpenPop(val, w, h) {
            if (true == window.showModalDialog(val, window.self, "dialogwidth=" + w + ";dialogheight=" + h + ";")) {
                __doPostBack('btn_reload', 'btn_reload_Click');
            }

        }
       
    </script>
     <link href="../../jquery-ui.min.css" rel="stylesheet" />
    <script src="../../js/jquery.js"></script>
    <script src="../../js/jquery-ui.min.js"></script>
     <script type="text/javascript">
         $(function () {
             $("#txt_projectName").autocomplete({
                 minLength: 1, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../../Handler.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { label: item.projectName + item.proid, value: item.projectName };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });
         </script>
</head>
<body style="font-size: 9pt;">
    <form id="form1" runat="server">
    <table cellpadding="0" cellspacing="0" class="style1">
        <tr>
            <td style=" height:15px;">
                &nbsp;</td>
        </tr>
        <tr>
            <td style=" text-align:center;" class="style2">
                <b>当月供应计划状态列表</b></td>
        </tr>
        <tr>
            <td style=" height:15px;">
                <asp:Label ID="lbl_se" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style=" height:15px;">
                &nbsp;</td>
        </tr>
        <tr>
            <td style=" height:15px;">
                   项目名称：<asp:TextBox ID="txt_projectName" runat="server"></asp:TextBox>
                &nbsp; 物料描述：<asp:TextBox ID="txt_material" runat="server"></asp:TextBox>
                   &nbsp;供应年月：<asp:TextBox ID="txt_ghqStart" runat="server" 
                     onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" Width="80px"></asp:TextBox>
                 至<asp:TextBox ID="txt_ghqEnd" runat="server" 
                     onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" Width="80px"></asp:TextBox>
                &nbsp; <asp:Button ID="btn_sel" runat="server" CssClass="btn" onclick="btn_sel_Click" 
                    Text="查询" /></td>
        </tr>
        <tr>
            <td style=" height:15px;">
                &nbsp;</td>
        </tr>
        <tr>
            <td style=" height:15px; text-align:center;">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    BorderWidth="0px" CellPadding="0" CellSpacing="1" CssClass="gv" GridLines="None"
                    onrowcommand="GridView1_RowCommand" Width="1800px" AllowPaging="True" 
                    onpageindexchanging="GridView1_PageIndexChanging" 
                    onrowdatabound="GridView1_RowDataBound" PageSize="20">
                    <Columns>
                        <asp:TemplateField HeaderText="操作" Visible="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton3" runat="server" CommandName="outconfirm">确认函</asp:LinkButton>
                                <asp:LinkButton ID="LinkButton4" runat="server" CommandName="outex">催交函</asp:LinkButton>
                                <asp:LinkButton ID="lbn_add" runat="server" 
                                    CommandArgument='<%# Bind("supplyPlanId") %>' CommandName="lbn_add" 
                                    ForeColor="Blue">生成当月供应计划</asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="remark" HeaderText="备注提醒" />
                        <asp:BoundField DataField="projectName" HeaderText="项目名称" />
                        <asp:BoundField DataField="proid" HeaderText="项目编号" />
                        <asp:BoundField DataField="material" HeaderText="物料描述" />
                        <asp:BoundField DataField="sname" HeaderText="供应商" />
                        <asp:TemplateField HeaderText="供应年月">
                            <ItemTemplate>
                                <asp:Label ID="lbl_supplyDate" runat="server" 
                                    Text='<%# Bind("supplyDate", "{0:d}") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("supplyDate") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="thisMonthCount" HeaderText="本月计划数量" />
                        <asp:BoundField DataField="unit" HeaderText="单位" />
                        <asp:BoundField DataField="result" HeaderText="完成结果" />
                    </Columns>
                     <PagerStyle CssClass="mypager" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td style=" height:15px;">
                <asp:Button ID="btn_reload" runat="server" onclick="btn_reload_Click" 
                    Visible="False" />
                <asp:Button ID="btn_out" runat="server" onclick="btn_out_Click" 
                    Text="导出Excel" />
            </td>
        </tr>
        <tr>
            <td style=" height:15px;">
                &nbsp;</td>
        </tr>
        </table>
</form></body></html>